package routes

import (
	"goravel/app/http/controllers"

	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/facades"
	"github.com/goravel/framework/support"
)

func Web() {
	facades.Route().Get("/", func(ctx http.Context) http.Response {
		return ctx.Response().View().Make("welcome.tmpl", map[string]any{
			"version": support.Version,
		})
	})

	sqqqController := controllers.NewSqqqController()

	// 访问静态文件的路由定义: http://localhost:3000/storage/dog.jpeg
	// facades.Route().Static("storage", "./storage/app/public")

	// ###########数据库基础
	facades.Route().Get("/sqqq/db", sqqqController.Filestorage)

	// ###########数据库关系
	facades.Route().Get("/sqqq/orm", sqqqController.Filestorage)

	// 文件存储
	facades.Route().Get("/sqqq/file", sqqqController.Filestorage)
	// 缓存
	facades.Route().Get("/sqqq/cache", sqqqController.Cacheplay)
	// 队列
	facades.Route().Get("/sqqq/queue", sqqqController.Queue)
	// 发送邮件
	facades.Route().Get("/sqqq/email", sqqqController.Sendmail)
	// helps辅助函数
	facades.Route().Get("/sqqq/helper", sqqqController.Helper)
	// jwt认证
	facades.Route().Get("/sqqq/jwt", sqqqController.Jwttoken)
	// 加密解密
	facades.Route().Get("/sqqq/encrypt", sqqqController.Encrypted)
	// 密码hash
	facades.Route().Get("/sqqq/hash", sqqqController.Hash)
	// 文件下载
	facades.Route().Get("/sqqq/download", sqqqController.Download)
	// 请求
	facades.Route().Get("/sqqq/req", sqqqController.RequestPlayer)
	// 响应
	facades.Route().Get("/sqqq/res", sqqqController.ResponsePlayer)
	// 日志打印
	facades.Route().Get("/sqqq/log", sqqqController.LogPrint)

	// 增删改查
	facades.Route().Get("/sqqq/list", sqqqController.List)
	facades.Route().Post("/sqqq/create", sqqqController.Create)
	facades.Route().Put("/sqqq/update", sqqqController.Update)
	facades.Route().Delete("/sqqq/destroy", sqqqController.Destroy)
	facades.Route().Patch("/sqqq/update", sqqqController.Update)
	facades.Route().Options("/sqqq/olist", sqqqController.List)
	facades.Route().Any("/sqqq/show", sqqqController.Show)
}
